﻿<ui:View x:Class="CPPEI.Coolzon.Designer.Views.HeaderView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:ui="clr-namespace:CPPEI.Coolzon.UI;assembly=CPPEI.Coolzon.UI"
         xmlns:local="clr-namespace:CPPEI.Coolzon.Designer.Views;assembly=CPPEI.Coolzon.Designer.Views"
             mc:Ignorable="d" 
             d:DesignHeight="30" d:DesignWidth="1000">
    <UserControl.Resources>
        <Style x:Key="btnCloseStyle" TargetType="{x:Type Button}">
            <Setter Property="Width" Value="47"/>
            <Setter Property="Height" Value="19"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <StackPanel Orientation="Horizontal" >
                            <Image Name="btnCloseImg" Source="./Images/X.png" />
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Source" TargetName="btnCloseImg" Value="./Images/X2.png"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="btnMaxStyle" TargetType="{x:Type Button}">
            <Setter Property="Width" Value="29"/>
            <Setter Property="Height" Value="19"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <StackPanel Orientation="Horizontal" >
                            <Image Name="btnMaxImg" Source="./Images/O.png" />
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Source" TargetName="btnMaxImg" Value="./Images/O2.png"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="btnRestoreStyle" TargetType="{x:Type Button}">
            <Setter Property="Width" Value="29"/>
            <Setter Property="Height" Value="19"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <StackPanel Orientation="Horizontal" >
                            <Image Name="btnRestoreImg" Source="./Images/Oo.png" />
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Source" TargetName="btnRestoreImg" Value="./Images/Oo2.png"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="btnMinStyle" TargetType="{x:Type Button}">
            <Setter Property="Width" Value="29"/>
            <Setter Property="Height" Value="19"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <StackPanel Orientation="Horizontal" >
                            <Image Name="btnMinImg" Source="./Images/-.png" />
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Source" TargetName="btnMinImg" Value="./Images/-2.png"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid Background="#FFF0F0F0" MouseLeftButtonDown="Grid_MouseLeftButtonDown" MouseDown="Grid_MouseDown">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Label Content="场景设计器" Width="200" HorizontalAlignment="Left" Grid.Column="0" Margin="15,5,0,0" FontSize="18" FontFamily="微软雅黑"/>
        <Menu VerticalAlignment="Center" Grid.Column="1" Background="Transparent" Height="25" Margin="0,5,0,0">
            <MenuItem x:Name="file" Header="文件(_F)">
                <MenuItem x:Name="btnNew" Header="新建方案(_N)" InputGestureText="Ctrl+N" Command="local:UICustomCommand.AddSolution"></MenuItem>
                <MenuItem x:Name="btnOpen" Header="打开方案(_O)" InputGestureText="Ctrl+O" Command="local:UICustomCommand.OpenSolution"></MenuItem>
                <Separator/>
                <MenuItem x:Name="btnSave" Header="保存(_S)" InputGestureText="Ctrl+S" Command="local:UICustomCommand.Save"></MenuItem>
                <Separator/>
                <MenuItem x:Name="btnSwitchWorkSpace" Header="切换工作空间" Command="local:UICustomCommand.SwitchWorkSpace"></MenuItem>
                <Separator/>
                <MenuItem x:Name="btnExit" Header="退出(_X)" Command="local:UICustomCommand.Exit"></MenuItem>
            </MenuItem>
            <MenuItem x:Name="_ctlEditMI" Header="编辑(_E)">
            </MenuItem>
            <MenuItem Header="视图(_V)">
                <MenuItem Header="解决方案" x:Name="_ctlSolutionMI" Command="local:UICustomCommand.ShowOrHideView" CommandParameter="SolutionAnchorable" IsChecked="True"  ></MenuItem>
                <MenuItem Header="工具箱" x:Name="_ctlToolboxMI" Command="local:UICustomCommand.ShowOrHideView" CommandParameter="ToolboxAnchorable" IsChecked="True"  ></MenuItem>
                <MenuItem Header="属性" x:Name="_ctlPropertyMI" Command="local:UICustomCommand.ShowOrHideView" CommandParameter="PropertyAnchorable" IsChecked="True"  ></MenuItem>
                <MenuItem Header="事件" x:Name="_ctlEventMI" Command="local:UICustomCommand.ShowOrHideView" CommandParameter="EventAnchorable" IsChecked="True"  ></MenuItem>
                <MenuItem Header="组件树" x:Name="_ctlPartTreeMI" Command="local:UICustomCommand.ShowOrHideView" CommandParameter="PartTreeAnchorable" IsChecked="True"  ></MenuItem>
            </MenuItem>
            <MenuItem Header="版本(_R)">
                <MenuItem Name="btnCheckIn" Header="签入" Command="local:UICustomCommand.CheckIn" ></MenuItem>
                <MenuItem Name="btnCheckOut" Header="签出" Command="local:UICustomCommand.CheckOut" ></MenuItem>
                <MenuItem Header="查看最新" Visibility="Collapsed" ></MenuItem>
                <MenuItem Header="撤销修改" Command="local:UICustomCommand.UndoPendingChanges"></MenuItem>
                <MenuItem Header="查看历史" Command="local:UICustomCommand.ViewHistory" ></MenuItem>
                <MenuItem Header="获取特定版本" Command="local:UICustomCommand.GetSpecificVersion" ></MenuItem>
            </MenuItem>
            <MenuItem Visibility="Collapsed">
                <MenuItem.Header>
                    <TextBlock Text="布局" TextAlignment="Center" />
                </MenuItem.Header>
                <MenuItem Header="水平左对齐"></MenuItem>
                <MenuItem Header="水平右对齐" ></MenuItem>
                <MenuItem Header="水平中对齐" ></MenuItem>
                <MenuItem Header="竖直上对齐" ></MenuItem>
                <MenuItem Header="竖直下对齐" ></MenuItem>
                <MenuItem Header="竖直中对齐" ></MenuItem>
                <MenuItem Header="宽度一致" ></MenuItem>
                <MenuItem Header="高度一致" ></MenuItem>
                <MenuItem Header="同样大小" ></MenuItem>
                <MenuItem Header="至于顶层" ></MenuItem>
                <MenuItem Header="至于低层" ></MenuItem>
            </MenuItem>
            <MenuItem Header="数据源(_D)">
                <MenuItem Header="编辑数据源" Command="local:UICustomCommand.EditDataSource" />
                <MenuItem Header="数据源预览" Command="local:UICustomCommand.DataSourcePreview"/>
                <MenuItem Header="静态数据源管理" Command="local:UICustomCommand.ManageStaticDataSource"/>
            </MenuItem>
            <MenuItem Visibility="Collapsed">
                <MenuItem.Header>
                    <TextBlock Text="预览" TextAlignment="Center" />
                </MenuItem.Header>
                <MenuItem Header="预览场景"></MenuItem>
                <MenuItem Header="预览方案" ></MenuItem>
            </MenuItem>
            <MenuItem Header="窗口(_W)">
                <MenuItem Header="网格线"  >
                    <MenuItem Header="无" Command="local:UICustomCommand.ChangeGridLineType" CommandParameter="x0"/>
                    <MenuItem Header="5x5" Command="local:UICustomCommand.ChangeGridLineType" CommandParameter="x5"/>
                    <MenuItem Header="10x10" Command="local:UICustomCommand.ChangeGridLineType" CommandParameter="x10"/>
                    <MenuItem Header="50x50" Command="local:UICustomCommand.ChangeGridLineType" CommandParameter="x50"/>
                    <MenuItem Header="100x100" Command="local:UICustomCommand.ChangeGridLineType" CommandParameter="x100"/>
                </MenuItem>
                
            </MenuItem>
            <MenuItem Header="发布(_P)">
                <MenuItem Header="发布方案到本地" Command="local:UICustomCommand.PublishToFileSystem" ></MenuItem>
                <MenuItem Header="发布到服务器" Command="local:UICustomCommand.PublishToServer" Visibility="Collapsed"  ></MenuItem>
                <MenuItem Header="发布数据源到服务器" Command="local:UICustomCommand.PublishDataSourceToServer" Visibility="Collapsed"  ></MenuItem>
                <MenuItem Header="发布数据源到本地" Command="local:UICustomCommand.PublishDataSourceToFileSystem" Visibility="Visible"  ></MenuItem>
            </MenuItem>
            <MenuItem Visibility="Visible" Header="帮助(_H)">
                <MenuItem Header="关于(_A)" Command="local:UICustomCommand.About"></MenuItem>
            </MenuItem>
        </Menu>
        <StackPanel Grid.Column="2" Orientation="Horizontal" FlowDirection="RightToLeft">
            <Button x:Name="_ctlClose" Click="_ctlClose_Click" Style="{StaticResource btnCloseStyle}"/>
            <Button x:Name="_ctlMax" Click="_ctlMax_Click" Style="{StaticResource btnRestoreStyle}"/>
            <Button x:Name="_ctlMin" Click="_ctlMin_Click" Style="{StaticResource btnMinStyle}"/>
        </StackPanel>
    </Grid>
</ui:View>
